package com.shaozg.studydemo;

import com.shaozg.studydemo.advanced_control_activity.ListViewActivity;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class AdvancedControlActivity extends Activity implements OnClickListener {
	private Button mListViewBtn;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_advanced_control);
		
		mListViewBtn = (Button)findViewById(R.id.advanced_control_listview);
		mListViewBtn.setOnClickListener(this);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.advanced_control, menu);
		return true;
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		Intent intent = new Intent();
		int id = v.getId();
		switch (id) {
		case R.id.advanced_control_listview:
			intent.setClass(this, ListViewActivity.class);
			startActivity(intent);
			break;

		default:
			break;
		}
	}
}
